When a paper document or a photograph is scanned by a scanning device such as flatbed type or rotary (production) type, the sensor scan width is often set to a wider range relative to the document to order to contain different size of documents. This results in an unwanted border, either in black or in white, surrounding the original document in the digital image. In addition, the resulting digital image is often skewed, either due to the mechanical imperfection of paper transportation in a production scanner or the improper placement of a print in a flatbed scanner or scanner input feeder. To reproduce a digital version which is identical to the appearance and size of the original document requires skew angle and location detection of the document in the digital image.
Various methods related to the skew angle and location of a digital image were published in U.S. Pat. Nos. 5,818,976; 5,452,374; and 5,974,199. These methods in the prior art detect a skew angle based on the slope of the detected document borders inside a digital image. In most cases the slope of the top border in the detected document is taken as the skew angle of the document so that the completed document can be reconstructed and located.
The success of the prior art in detecting document skew and in locating a document requires a clean straight border of a document. Any jaggedness on a border, or incomplete border, or partially torn border of a document, or irregular shape of a document, often results in the failure of skew and location detection. This dependence on a clean border for detecting skew and location of a document greatly reduces the robustness of these methods for use in heavy duty scanning environment. There is a need for a method of detecting skew angle and location of a document independent of the roughness of document borders and the irregularity of a document shape.